package com.zycfc.zsf.boot.mybatis.page;

import java.util.function.*;
import java.util.*;

public class ZsfPageUtil
{
    public static <T> ZsfPage<T> toPage(final List<T> list) {
        return new ZsfPage<T>(list);
    }
    
    public static <E, T> ZsfPage<T> toPage(final List<E> data, final Function<E, T> function) {
        final List<T> list = new ArrayList<T>(data.size());
        for (final E e : data) {
            list.add(function.apply(e));
        }
        return new ZsfPage<T>(list);
    }
}
